package com.antu.first.enums;

/**
 * Created by Administrator on 2018/3/6.
 */
public enum ReplyStateEnum {

    SUCCESS(0,"评论成功"),ERROR(1,"评论失败"),EMPTY_REPLY(-1,"回复内容为空"),INNER_ERROR(2,"登录状态异常");

    private int state;

    private String stateInfo;

    ReplyStateEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    public static ReplyStateEnum valueOf(int key){
        for(ReplyStateEnum stateEnum:values()){
            if(stateEnum.getState() == key) {
                return stateEnum;
            }
        }
        return null;
    }
}
